//
//  Hot_todView.m
//  CarOfHome2
//
//  Created by dlios on 15/9/23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Hot_todView.h"

@implementation Hot_todView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.flowLayOut = [[UICollectionViewFlowLayout alloc] init];
        self.collectView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:self.flowLayOut];
        [self addSubview:self.collectView];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.collectView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    self.flowLayOut.itemSize = CGSizeMake(self.frame.size.width, self.bounds.size.height);
    self.collectView.pagingEnabled = YES;/* 翻页 */
    self.collectView.showsHorizontalScrollIndicator = NO;//横向滚动条
    self.flowLayOut.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
    [self.flowLayOut setScrollDirection:UICollectionViewScrollDirectionHorizontal];/* 横向滚动 */
    self.flowLayOut.minimumLineSpacing = 0;
    self.collectView.backgroundColor = [UIColor whiteColor];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
